<?php
  
  
  require "../system/framework.php";  
  require_once ("../system/api/simplehtmldom/simple_html_dom.php");
 
 
 
 
 //file::copyFolder("c:/bilder", "c:/tmp");
 
 //exit;

 
 
 //file::createFolder('k:/Web/content/', false);
 //echo file::readTextFile('K:\Web\test2.txt', false); 
 //project::compileProject('C:\My Dropbox\Kunden\verein.waldstock.ch', 'C:\Inetpub\wwwroot');
 //project::compileProject('C:\My Dropbox\Kunden\verein.waldstock.ch', 'C:\Programme\EasyPHP-5.3.5.0\www');
   
   
   //project::compileProject('C:\Daten\ProjectManager', 'C:\Programme\EasyPHP-5.3.6.0\www', false);
   
   
   //project::compileProject('C:\Daten\verein.waldstock.ch', 'C:\Programme\EasyPHP-5.3.6.0\www', false);
   //project::compileProject('C:\Daten\Furrer', 'C:\Programme\EasyPHP-5.3.6.0\www', false);
   
  // project::compileProject('C:\Daten\catch24', 'C:\Programme\EasyPHP-5.3.6.0\www', false);
   
   
   
   $projectPath = 'C:\Daten\verein.waldstock.ch';
   $project = new project($projectPath);
   $project->compileProject();
   
                            //'C:\Daten\catch24', 'C:\Programme\EasyPHP-5.3.6.0\www', false
   
   
   
      
 
 // Khm
 //project::compileProject('C:\project\khm', 'C:\project\khm\distribution');
 
 
 
 
 
 /*
 general_config::$projectPath = 'C:\project\khm';
 
 
 $path = general_config::$projectPath;
 
 
 //project::installProject(general_config::$projectPath);
 
 
   datastructure::createFolderStructure(general_config::$projectPath);
     
 
 //$distributionPath = "$path/distribution"; 
 $distributionPath = 'C:\xampp\htdocs\khm';
 
 file::createFolder("$path/distribution", false);
 
 $phpScriptPath = "$distributionPath/php_script/";
 file::createFolder($phpScriptPath, false);
 
 
 
 
 //$phpScriptPath = "$path/distribution/php_script/";
 
     
 
 $compile = new compile();  
 $compile->phpScriptPath = $phpScriptPath;
 $compile->distrubtionPath = $distributionPath."/";
     
     
 
 
 
 
 foreach (folder::getFolder("$path/content", false, true, false, false) as $content) {
     
     // echo $content['dir'];
     $compile->compileFile($content['dir'], "$distributionPath/{$content['filename']}", false, false);
     
 }

 
 
 
 /*xml_config::createTable("table_one");
 
 
 
 
 print_r(xml_config::getTable());
 
 
 
    /*
 global $projectPath;
 
 $filename = "$projectPath/db/table.xml";
 
 
 global $rootDir;

    $xml = simplexml_load_file($rootDir.$filename);

    // echo $xml->getName;
    
    foreach ($xml->table as $table) {
        
        //echo $item->getName;
        echo "tabelle ".$table['name'];
        
        db::createTable($table['name'], "data");
        
        
        foreach ($table->field as $field) {
            
            echo $field['name'];
            $fieldType = $field['type'];
            if ($fieldType !== "") {
                $fieldType = "text";
            }
            
            
            db::addTableField($table['name'], $field['name'], $fieldType);
            
        } 
        
        
        
        //print_r($item);
        echo "---------------";
    }
    
    
    
    foreach ($xml->folder as $item) {
        
        //echo $item->getName;
        echo "folder ".$item['dir'];
        
      /*  foreach ($item as $field) {
            
            echo $field['name'];
            
        } */
        
        
        
        //print_r($item);
   /*     echo "---------------";
    }
    
    
 /*   $xml->addChild('title', 'PHP2: More Parser Stories');
    
    
  echo $xml->saveXML();
    
    
    
   //print_r($xml);

    
    
 
 
 
 
 
 
 
 
 
 
 
 
 //yaml_parse_file("");
 
  //   yaml_emit_file();
 
   /*
// define PHP array
$data = array(
    'a' => 'America',
    'b' => 'Brazil',
    'c' => 'Canada',
    'd' => 'Denmark',
    'e' => 'England',
);

// convert to YAML and print
$yaml = syck_dump($data);
echo $yaml;
 
 
 
 
 
 
 
 
 
 
 /* $projectPath = 'C:\Dokumente und Einstellungen\Administrator\Desktop\Blog Project\Web\content';
  
  
  
  foreach (folder::getFolder($projectPath, false, true, true, false) as $file) {
  
      
      //print_r($file);
      
      echo $file['dir']."<br>";
      
      
      
      
      
  }
  
  
  
    */
  
  
  
  
  
  
  
  
?>
